﻿using System.Drawing;
using ImageCompressorCLI;

public class ImageCompressionService
{
    public byte[] CompressImage(byte[] imageData, int maxWidth = 600, int maxHeight = 450, int quality = 75)
    {
        try
        {
            // 调用C++/CLI压缩库
            return ImageCompressor.CompressImage(imageData, maxWidth, maxHeight, quality);
        }
        catch (Exception ex)
        {
            throw new ApplicationException("Image compression failed", ex);
        }
    }
}